package com.project.bean;

import javax.validation.constraints.*;

public class EmployeeBean {
    @NotBlank(groups = VoildAdd.class,message = "姓名不能为空")
    @Pattern(groups = VoildAdd.class,regexp = "[a-zA-Z\\u4e00-\\u9fa5]{2,}"
            ,message = "姓名必须是两位以上汉字或字母")
    private String name;
    @Pattern(groups = VoildUpdate.class,regexp = "\\d{6}",message = "密码必须是6位数字")
    private String pwd = "666";
    @Min(groups = {VoildAdd.class,VoildUpdate.class},value = 2000,message = "黑心老板，2000工资都不给吗？")
    @Max(groups = {VoildAdd.class,VoildUpdate.class},value = 20000,message = "工资不能多于2万")
    private int money;
    @Pattern(groups = VoildAdd.class,regexp = "1[3578]\\d{9}")
    private String tel;
    @NotBlank(groups = VoildAdd.class,message = "邮件必须填写")
    @Email(message = "邮件格式为XXX@qq.com")
    private String email;

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public int getMoney() {
        return money;
    }

    public void setMoney(int money) {
        this.money = money;
    }

    public String getTel() {
        return tel;
    }

    public void setTel(String tel) {
        this.tel = tel;
    }

    @Override
    public String toString() {
        return "EmployeeBean{" +
                "name='" + name + '\'' +
                ", pwd='" + pwd + '\'' +
                ", money=" + money +
                ", tel='" + tel + '\'' +
                '}';
    }
}
